﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Calendar.aspx.cs" Inherits="user_Calendar" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphPageTitle" runat="Server">
    <asp:UpdatePanel runat="server" ID="uplViewType">
        <ContentTemplate>
            <asp:Label runat="server" ID="lblViewType" Text="View Type" Font-Bold="true" />
            <asp:DropDownList ID="ddlViewType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlViewType_SelectedIndexChanged">
                <asp:ListItem Text="Month" Value="1" />
                <asp:ListItem Text="Week" Value="2" />
                <asp:ListItem Text="Today" Value="3" />
                <asp:ListItem Text="Four Day" Value="4" />
            </asp:DropDownList>
            <asp:RadioButtonList Visible="false" CssClass="sTable" AutoPostBack="true" runat="server"
                RepeatDirection="Horizontal" ID="rdoViewType" OnSelectedIndexChanged="rdoViewType_SelectedIndexChanged">
                <asp:ListItem Text="Month" Value="1" />
                <asp:ListItem Text="Week" Value="2" />
                <asp:ListItem Text="Today" Value="3" />
                <asp:ListItem Text="4 Days" Value="4" />
            </asp:RadioButtonList>
            &nbsp;&nbsp;
            <asp:HyperLink runat="server" ID="hplPendingCall" Text="<%$Resources:General,PendingAndScheduleStatus%>"
                NavigateUrl="~/carinsurance/CheckAgentCallStatus.aspx" CssClass="wButton bluewB mr15 mt10" />
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel runat="server" ID="UpdatePanel1">
        <ContentTemplate>
            <asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="Gray"
                ShowGridLines="true" BorderWidth="1px" Font-Size="10pt" ForeColor="Black" Height="400px"
                NextPrevFormat="FullMonth" OnDayRender="Calendar1_DayRender" OnSelectionChanged="Calendar1_SelectionChanged"
                OnVisibleMonthChanged="Calendar1_VisibleMonthChanged" Width="800px" SelectionMode="None">
                <SelectedDayStyle BackColor="#333399" ForeColor="White" />
                <TodayDayStyle BackColor="#ffffcc" />
                <OtherMonthDayStyle ForeColor="#999999" />
                <WeekendDayStyle BackColor="#f7f7f7" />
                <NextPrevStyle Font-Bold="True" Font-Size="8pt" Font-Underline="true" ForeColor="#333333" VerticalAlign="Bottom" />
                <DayHeaderStyle Font-Bold="True" Font-Size="8pt" />
                <TitleStyle BackColor="White" Font-Bold="True" Font-Size="14pt" ForeColor="#333399" />
            </asp:Calendar>
            <asp:GridView ID="GridView1" Visible="False" runat="server" Font-Size="10pt" CellPadding="3"
                ForeColor="#333333" GridLines="None" Width="800px" Height="400px" OnRowDataBound="GridView1_RowDataBound">
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Center" />
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                <HeaderStyle BackColor="#5D7B9D" Font-Size="Small" Font-Bold="True" ForeColor="White" />
                <EditRowStyle BackColor="#999999" />
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            </asp:GridView>
        </ContentTemplate>
    </asp:UpdatePanel>

    <script type="text/javascript">
        var prm = Sys.WebForms.PageRequestManager.getInstance();
        prm.add_initializeRequest(InitializeRequest);
        prm.add_endRequest(EndRequest);
        var postBackElement;
        function InitializeRequest(sender, args) {
            if (prm.get_isInAsyncPostBack())
                args.set_cancel(true);
            postBackElement = args.get_postBackElement();
            OnOffUpdateProgress(true);
        }


        function OnOffUpdateProgress(onOff) {
            if ($get('<%=ddlViewType.ClientID%>') != null) {
                $get('<%=ddlViewType.ClientID%>').disabled = onOff;
            }

            if ($get('<%=hplPendingCall.ClientID%>') != null) {
                $get('<%=hplPendingCall.ClientID%>').disabled = onOff;
            }

        }

        function EndRequest(sender, args) {
            OnOffUpdateProgress(false);
        }
        
    </script>

</asp:Content>
